package com.cjq.allservice.service.impl;

import com.cjq.allservice.entity.Cart;
import com.cjq.allservice.entity.vo.CartVo;
import com.cjq.allservice.mapper.CartMapper;
import com.cjq.allservice.service.CartService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cjq
 * @since 2022-01-11
 */
@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {


    @Autowired
    CartMapper cartMapper;

    @Override
    public List<CartVo> getAllCartsByUserId(String userId) {
        System.out.println(cartMapper);
        List<CartVo> cartVos = cartMapper.getAllCartVosByUserId(userId);
        return cartVos;
    }
}
